# -*- coding: utf-8 -*-
import cv2
from matplotlib import pyplot as plt
# 显示多张图片
img = cv2.imread('cat.jpg',0)   #读入灰度图片

img2 = cv2.imread('cat.jpg',1)  #读入彩色图片

img3 = cv2.imread('cat.jpg',-1) #读入完整图片
#三个窗口显示三张图片
cv2.imshow('cv2.IMREAD_COLOR', img2)
cv2.waitKey(0)
cv2.destroyAllWindows()

cv2.imshow('cat', img2)
cv2.waitKey(0)
cv2.destroyAllWindows()

cv2.imshow('cat', img2)
cv2.imshow('cat', img3)
cv2.waitKey(0)
cv2.destroyAllWindows()

#
# #一个界面显示多张图片
# plt.subplot(2, 2, 1)
# plt.title('cv2.IMREAD_GRAYSCALE')
# plt.imshow(img)
#
# plt.subplot(2, 2, 2)
# plt.title('cv2.IMREAD_COLOR')
# plt.imshow(img2)
#
# plt.subplot(2, 2, 3)
# plt.title('cv2.IMREAD_UNCHANGED')
# plt.imshow(img3)
#
# plt.show()